<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.util.Date" %>
<%@ page import="jp.co.cos.ittrick.channel.model.ChannelModel" %>
<%@ page import="jp.co.cos.ittrick.channel.model.ChapterModel" %>
<%@ page import="jp.co.cos.ittrick.channel.model.PageModel" %>
<%@ page import="jp.co.cos.ittrick.channel.model.PreModel" %>
<%@ page import="jp.co.cos.ittrick.channel.model.ApplicationModel" %>
<%@ page import="java.util.List" %>
<%
String dateValue = new java.text.SimpleDateFormat( "yyyy", java.util.Locale.US).format(new Date());
%>

	<footer class="clear">
		<div id="footerContents">
			<section id="footerLeftContents">
				<h3>最近の記事</h3>
				<ul>
					<%
					List<PageModel> newPageList = (List<PageModel>)request.getAttribute("newPageList");
					for(PageModel newPageModel: newPageList) {
/* 						ChapterModel newChapterModel = newPageModel.getChapterModelRef().getModel();
						ChannelModel newChannelModel = newChapterModel.getCategoryModelRef().getModel().getChannelModelRef().getModel(); */
					%>
					<li class="navi">
						<%=newPageModel.pageUrlString %>
					</li>
					<% } %>
				</ul>
			</section>

			<section id="footerRightContents">
				<h3>カテゴリ一覧</h3>
				<%
				List<ChannelModel> channelList = (List<ChannelModel>)request.getAttribute("channelList");
				ApplicationModel applicationModel = (ApplicationModel)request.getAttribute("applicationModel");
				if(channelList.size() > 0) {
				%>
				<div id="features">
					<%
					for(int i=0; i < channelList.size(); i++) {
						ChannelModel cModel = channelList.get(i);
						if((i + 1)%2 != 0) {
					%>
					<div class="c12">
					<%	}else { %>
					<div class="c22">
					<%	} %>
						<div class="imgleft">
							<img alt="<%=cModel.getName() %>" width="80" src="http://ittrick.vs.land.to/<%=applicationModel.getApplicationId() %>/images/<%=cModel.getKeyString() %>.png" >
						</div>
						<h4><a href="/<%=cModel.getKeyString() %>.html"><%=cModel.getName() %></a></h4>
						<p><%=cModel.getDescription() %></p>
					</div>
					<%
						if((i + 1)%2 == 0 || (i + 1) == channelList.size()) {
					%>
					<div class="spacer"></div>
					<%	} %>
					<%} %>
				</div>
				<%} %>
			</section>
		</div>

		<section id="copyrightBlock">
			<div id="siteList">
				<h4>姉妹サイト</h4>
				<jsp:include page="/common/siteList.jsp" />
			</div>

			<ul id="logos" class="clear">
				<li>
					<a href="http://code.google.com/intl/ja/appengine/" rel="nofollow" TARGET="_blank">
						<img alt="Powered by Google App Engine" src="http://code.google.com/appengine/images/appengine-silver-120x30.gif">
					</a>
				</li>
				<li>
					<a href="http://www.w3.org/html/logo/" rel="nofollow" TARGET="_blank">
						<img src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" width="120" alt="HTML5 Powered with CSS3 / Styling, and Semantics" title="HTML5 Powered with CSS3 / Styling, and Semantics">
					</a>
				</li>
			</ul>
			<p id="copyright">Copyright &copy; <%=dateValue %> it-trick All Rights Reserved</p>
		</section>
	</footer>
